   var getMenu =function(){
    	console.log(1);
    	$.ajax({
    		url:'../getMenu',
    		type:'post',
    		dataType:'json',
    		success:function(result){
    			console.log(result);
    			$.each(result.menuList,function(inx,ele){
    				$("#menu").append("<button type='button' class='btn btn-info active' onclick='getChildMenu("+
    						ele.menuId+")'>"+
    						ele.menuName+"</button>");
    			})
    			
    		}
    	})  
      };
    var getJspName=function(childMenuId){
    	console.log(3);
    	$.ajax({
    	url:'../getJspName',
    	type:'post',
    	data:{childMenuId:childMenuId},
    	dataType:'json',
    	success:function(result){
    		if(result.jspName!=null){
    		$("#iTable").html("");
    		
    		$("#iTable").append("<iframe class='iframeArea' src="+result.jspName+" name='ableContract'  style='width:1050px;height:800px' scrolling='yes' frameborder='0'></iframe>");
    	
    		}else{
    			$("#iTable").append("<iframe class='iframeArea' src='default.jsp' name='ableContract'  style='width:1050px;height:800px' scrolling='yes' frameborder='0'></iframe>");
    		}
    	}
    	})
       };
    var getChildMenu=function(menuId){
    	console.log(2);
    	$.ajax({
    	  url:'../getChildMenu',
    	  type:'post',
    	  data:{menuId:menuId},
    	  dataType:'json',
    	  success:function(result){
    		  console.log(result);
    		  /* $("#childMenu").append("<blockquote><p class='oneType'>"+menuName+"</p></blockquote>"); */
    		  $("#childMenu").html("");
    		  $.each(result.listChildMenu,function(inx,ele){
    			  console.log(ele.childMenuName);
    			  $("#childMenu").append("<button type='button' class='btn btn-success active' onclick='getJspName("+ele.childMenuId+")'>"+ele.childMenuName+"</button>");	  
    		  })
    	  }
    	})
    }
    var getDept=function(){
    	$.ajax({
    		url:'../dept/listDept',
    		type:'post',
    		dataType:'json',
    		success:function(result){
    			console.log(result);
    			$("#dept option:not(:first)").remove();
    			$.each(result.deptList,function(inx,ele){
    				
    				$("#dept").append("<option  value="+ele.deptId+">"+ele.deptName+"</option>");
    			
    			})
    		}
    		
    	})
    };
    var saveRole=function(){
    	var roleName=$("#roleName").val();
    	var deptId=$("#dept").val();
    	var roleRemarks=$("#roleRemarks").val();
    	$.ajax({
    		url:'../dept/saveRole',
    		type:'post',
    		data:{roleName:roleName,deptId:deptId,roleRemarks:roleRemarks},
    		dataType:'json',
    		success:function(result){	
    		  if(result.messages="添加成功"){
    			  window.location.reload();
    		  }else{
    			  
    			  $("#role")[0].reset();
    		  }
    		}
    	})
    };
    var getRoleMessage=function(){
    	var roleId=$("#getRole:checked").val();
    	if(roleId != null &&roleId !=''){
    		
    	$.ajax({
    		url:'../dept/getRoleMessage',
    		type:'post',
    		data:{roleId:roleId},
    		dataType:'json',
    	    success:function(result){
    	    	console.log(result.role.roleRemarks);
    	     $("#roleId").val(result.role.roleId);
    	     $("#roleName1").val(result.role.roleName);
    	     $("#roleRemarks1").val(result.role.roleRemarks);
    	     $.each(result.deptList,function(inx,ele){
    	      if(result.role.deptId==ele.deptId){
    	    	  $("#deptList").append("<option selected='selected' value="+ele.deptId+">"+ele.deptName+"</option>");
    	      }else{
    	    	  $("#deptList").append("<option  value="+ele.deptId+">"+ele.deptName+"</option>");  
    	      }	 
    	     });
    	    
    	    }
    	})
    	}else{
    		alert("没有选择角色");
    		window.location.reload();
    	}
    };
    
    var getListRole=function(){
    	$.ajax({
    		url:'../dept/getListRole',
    		type:'post',
    		dataType:'json',
    		success:function(result){
    			$("#conTable tr:not(:first)").remove();
    		  $.each(result.roleList,function(inx,ele){
    			  $.each(result.deptList,function(inx2,ele2){
    				if(ele.deptId==ele2.deptId){  
    			  $("#conTable").append("<tr class='active'><td>"+(inx+1)+"</td><td><input type='radio' id='getRole' name='getRole' value='"+
    					  ele.roleId+"'></td><td>"+
    					  ele.roleName+"</td><td>"+
    					  ele2.deptName+"</td><td>"+
    					  ele.updateTime+"</td></tr>");
    				}
    				})
    			  })	
    		}
    		
    	})
    };
    var deleteRole=function(){
    	var roleId=$("#getRole:checked").val();
    	if(roleId!=null){
    	if(confirm("确定删除该角色吗？")){
    	$.ajax({
    		url:'../dept/deleteRole',
    		type:'post',
    		data:{roleId:roleId},
    		dataType:'json',
    		success:function(result){
    			alert(result.message);
    			window.location.reload();
    		}
    	})
    	}
    	}else{
    		alert("没有选择角色");
    	}
    };
    var updateRole=function(){
    	
    	$.ajax({
    		url:'../dept/updateRole',
    		type:'post',
    		data:$("#myModal1 form").serialize(),
    	    dataType:'json',
    	    success:function(result){
    	     	alert(result.message);
    	     	window.location.reload();
    	    }
    	})
    	 
    };
    var getManageMenu=function(){
    	
    	var roleId=$("#getRole:checked").val();
    	if(roleId != null){
    	$.ajax({
    		url:'../dept/getManageMenu',
    		type:'post',
    		data:{roleId:roleId},
    		dataType:'json',
    		success:function(result){
    			console.log(result);
    			 $("#manageMenu").html("");
    		 $.each(result.listMenu,function(inx,ele){
    			 $("#manageMenu").append("<tr><td>"+
    					 ele.menuName+"</td><td><ul id='manage"+
    					 ele.menuId+"'></ul></td></tr>");
    			 $.each(result.listAllChildMenu,function(inx1,ele1){
    				 
    		         if(ele.menuId==ele1.menuId){
    		        	 $("#manage"+ele.menuId).append("<li ><input id='nw"+ele1.childMenuId+"' type='checkBox' name='childMenu' value='"+ele1.childMenuId+"'/>"+ele1.childMenuName+"</li>");
    		        	 $.each(result.listRolePower,function(inx2,ele2){
    		        	if(ele2.childMenuId==ele1.childMenuId){	
    		              $("#nw"+ele1.childMenuId).prop("checked","checked");
    		        	}
    		        	})
    		        	 
    		         }
    				 
    			 })
    		 })		 
    		}
    	})
    	}else{
    		alert("没有选择角色");
    		window.location.reload();
    	}
    };
    var givePower=function(){
    	var roleId=$("#getRole:checked").val();
    	/*var childMenu=$("input[name='childMenu']:checked").val();*/
    	var attr1 =[];
    	var attr="";
    	$("input[name='childMenu']:checked").each(function(i){
    		attr1[i]=$(this).val();
    		attr+=$(this).val()+",";
    		/*attr=$(this).val()+","*/
    	});
    	var childMenu=attr1;
    	console.log(attr);
    	console.log(childMenu);
    	var child=childMenu.toString();
    	$.ajax({
    		url:'../dept/givePower',
    		type:'post',
    		data:{roleId:roleId,attr:attr},
    	    dataType:'json',
    	    success:function(result){
    	    	alert(result.message);
    	    	window.location.reload();
    	    }
    	})
    }
    //下面的内容为deptManage的方法
   var getAllDept=function(){
	   $.ajax({
   		url:'../dept/listDept',
   		type:'post',
   		dataType:'json',
   		success:function(result){
   			console.log(result);
   			$("#dept option:not(:first)").remove();
   		$.each(result.deptList,function(inx,ele){
   			
   			$("#conTable").append("<tr><td>"+
   					(inx+1)+"</td><td><input type='radio' name='deptName' id='deptId' value='"+
   					ele.deptId+"'/></td><td>"+
   					ele.deptName+"</td><td>"+
   					ele.deptRemarks+"</td><td>"+
   					ele.createTime+"</td></tr>");
   		})
   		}
   		
   	})
   };
   var saveDept=function(){
	   $.ajax({
		   url:'../dept/saveDept',
		   type:'post',
		   data:$("#role").serialize(),
		   dataType:'json',
		   success:function(result){
			   alert(result.message);
			   window.location.reload();
		   }
	   })
   };
   var getDeptName=function(){
	   
	   var deptId=$("#deptId:checked").val(); 
	   if(deptId!=null){
	   $.ajax({
	   url:'../dept/getDeptName',
	   type:'post',
	   data:{deptId:deptId},
	   dataType:'json',
	   success:function(result){
		   $("#deptNo").val(deptId);
		   $("#deptName").val(result.dept.deptName);
		   $("#deptAllName").val(result.dept.deptAllName);
		   $("#deptIntro").val(result.dept.deptIntro);
		   $("#deptRemarks").val(result.dept.deptRemarks);
	   }
   }) 
   }else{
	   alert("没有选择部门");
	   window.location.reload();  
   }
   }
   var updateDept=function(){
	   $.ajax({
	   url:'../dept/updateDept',
	   type:'post',
	   data:$("#deptMessage").serialize(),
	   dataType:'json',
	   success:function(result){
		   alert(result.message);
		   window.location.reload();
	   }
	   })
   };
   var deleteDept=function(){
	   var deptId=$("#deptId:checked").val();
	   if(deptId!=null){
		   if(confirm("确定删除该部门吗？")){
	   $.ajax({
		   url:'../dept/deleteDept',
		   type:'post',	
		   data:{deptId:deptId},
		   dataType:'json',
		   success:function(result){
			   alert(result.message);
			   window.location.reload();
		   }
		   })
		   }
		   }else{
			   alert("没有选择部门");
			   window.location.reload(); 
		   }
   };
   
   //员工管理页面
   var getAllEmp=function(curr){
		 $.ajax({
			url:'../emp/getAllEmp',
			type:'post',
			data:{pageNum:curr},
		   	dataType:'json',
		   	success:function(result){
		   		console.log(result);
		   		$("#conTable tr:not(:first)").remove();
	   			$("#dept option:not(:first)").remove();
		   	  $.each(result.empList,function(inx,ele){
		   		  if(ele.state==0){
		   		$("#conTable").append("<tr><td>"+
		   				(inx+1)+"</td><td><input type='radio' name='employ' id='employ' value='"+
		   				ele.empId+"'/></td><td>"+
		   				ele.empRealName+"</td><td>"+
		   				ele.gender+"</td><td>"+
		   				ele.hyd.deptName+"</td><td>"+
		   				ele.hyr.roleName+"</td><td>启用</td><td>"+
		   				ele.hireDate+"</td><td>"+
		   				ele.hye.empRealName+"</td></tr>");
		   		}else{
		   		$("#conTable").append("<tr><td>"+
			   				(inx+1)+"</td><td><input type='radio' name='employ' id='employ' value='"+
			   				ele.empId+"'/></td><td>"+
			   				ele.empRealName+"</td><td>"+
			   				ele.gender+"</td><td>"+
			   				ele.hyd.deptName+"</td><td>"+
			   				ele.hyr.roleName+"</td><td>停用</td><td>"+
			   				ele.hireDate+"</td><td>"+
			   				ele.hye.empRealName+"</td></tr>");	
		   		
		   		}
		   	  })
		   	  $("#conTable").append("<tr><td id='page' colspan='9'></td></tr>")
		   	  	
		   	  	laypage({
				 cont:'page',//容器
			     pages:result.totalPages, //总页数
			     curr:curr||1,//当前页
			     skin:'molv',//皮肤
			     skip:true,//
			     last:'尾页',//
			     jump:function(obj,first){
			    	
			    	     if(!first){
			    	    	 getAllEmp(obj.curr);
			    	    	 }
			    	 }
			     
				})
		   	}
		   	})
	  };
	  var getDeptRole=function(){
		  $.ajax({
			  url:'../emp/getDeptRole',
			  type:'post',
			  dataType:'json',
			  success:function(result){
				  $("#empDept option:not(:first)").remove();
				  $("#empRole").html("");
				  $("#searchDept option:not(:first)").remove();
				$.each(result.deptList,function(inx,ele){
					$("#empDept").append("<option  value='"+ele.deptId+"'>"+ele.deptName+"</option>");
					$("#searchDept").append("<option  value='"+ele.deptId+"'>"+ele.deptName+"</option>");
				}) 
			  }
		  })
		  
	  };
	  var getRoleName=function(){
		 var deptId= $("#empDept").val();
		 $.ajax({
			 url:'../emp/getRoleName',
			 type:'post',
			 data:{deptId:deptId},
			 dataType:'json',
			 success:function(result){
				 $("#empRole").html("");
			 $.each(result.roleList,function(inx,ele){
           $("#empRole").append("<option value='"+ele.roleId+"'>"+ele.roleName+"</option>");	
				})
			 }
		 })
		 
	  };			
	var saveEmp=function(){
		$.ajax({
			url:'../emp/saveEmp',
			type:'post',
			data:$("#emp").serialize(),
			dataType:'json',
			success:function(result){
				alert(result.message);
				window.location.reload(); 
			}
		})
	};
	var getEmpMessage=function(){
	  var empId=$("#employ:checked").val();
	  console.log(empId);
	  if(empId!=null){
	  $.ajax({
		  url:'../emp/getEmpMessage',
		  type:'post',
		  data:{empId:empId},
		  dataType:'json',
		  success:function(result){
			$("#empId").val(result.emp.empId);
			$("#empRealName").val(result.emp.empRealName);
			
			$("#state[value='"+result.emp.state+"']").attr('checked','checked');
			$("#phone").val(result.emp.phone);
			$("#empRemarks").text(result.emp.empRemarks);
			$("#deptId").html("");
			$.each(result.deptList,function(inx,ele){
				if(result.emp.deptId==ele.deptId){
				$("#deptId").append("<option value='"+ele.deptId+"' selected='selected'>"+ele.deptName+"</option>");
				}else{
					$("#deptId").append("<option value='"+ele.deptId+"'>"+ele.deptName+"</option>");
				}
			})
			$("#roleId").html("");
			$("#roleId").append("<option value='"+result.emp.roleId+"'>"+result.emp.hyr.roleName+"</option>");
			$("#gender[value='"+result.emp.gender+"']").attr('checked','checked');
		  }
	  })
	  }else{
		  alert("请选择员工");
		  window.location.reload();	
	  }
	}
	
	var updateEmp=function(){
		
		$.ajax({
			url:'../emp/updateEmp',
			type:'post',
			data:$("#empMessage").serialize(),
			dataType:'json',
			success:function(result){
				alert(result.message);
				window.location.reload();	
			}
		})
	};
	var deleteEmp=function(){
		var empId=$("#employ:checked").val();
		console.log(empId);
		if(empId!=null){
			if(confirm("确定要删除该员工吗？")){
		$.ajax({
			url:'../emp/deleteEmp',
			type:'post',
			data:{empId:empId},
			dataType:'json',
			success:function(result){
				alert(result.message);
				window.location.reload();
			}
		})
			}
		}else{
			alert("请选择要删除的员工");
			window.location.reload();	
		}
	};
	var getNewRole=function(){
		 var deptId= $("#deptId").val();
		 $.ajax({
			 url:'../emp/getRoleName',
			 type:'post',
			 data:{deptId:deptId},
			 dataType:'json',
			 success:function(result){
				 $("#roleId").html("<option></option>");
			 $.each(result.roleList,function(inx1,ele2){
           $("#roleId").append("<option value='"+ele.roleId+"'>"+ele.roleName+"</option>");	
				})
			 }
		 })
	};
	var searchEmp=function(curr){
		var empRealName=$("#searchName").val();
		var gthireDate=$("input[name='gthireDate']").val();
		var lthireDate=$("input[name='lthireDate']").val();
		var deptId=$("#searchDept").val();
		var empRemarks=$("#searchRemarks").val();
		$.ajax({
			url:'../emp/searchEmp',
			type:'post',
			data:{empRealName:empRealName,gthireDate:gthireDate,lthireDate:lthireDate,deptId:deptId,empRemarks:empRemarks,curr:curr},
		    dataType:'json',
		    success:function(result){
		    	console.log(result);
		   		$("#conTable tr:not(:first)").remove();
	   			$("#dept option:not(:first)").remove();
		   	  $.each(result.empList,function(inx,ele){
		   		  if(ele.state==0){
		   		$("#conTable").append("<tr><td>"+
		   				(inx+1)+"</td><td><input type='radio' name='employ' id='employ' value='"+
		   				ele.empId+"'/></td><td>"+
		   				ele.empRealName+"</td><td>"+
		   				ele.gender+"</td><td>"+
		   				ele.hyd.deptName+"</td><td>"+
		   				ele.hyr.roleName+"</td><td>启用</td><td>"+
		   				ele.hireDate+"</td><td>"+
		   				ele.hye.empRealName+"</td></tr>");
		   		}else{
		   		$("#conTable").append("<tr><td>"+
			   				(inx+1)+"</td><td><input type='radio' name='employ' id='employ' value='"+
			   				ele.empId+"'/></td><td>"+
			   				ele.empRealName+"</td><td>"+
			   				ele.gender+"</td><td>"+
			   				ele.hyd.deptName+"</td><td>"+
			   				ele.hyr.roleName+"</td><td>停用</td><td>"+
			   				ele.hireDate+"</td><td>"+
			   				ele.hye.empRealName+"</td></tr>");	
		   		
		   		}
		   	  })
		   	  $("#conTable").append("<tr><td id='page' colspan='9'></td></tr>")
		   	  	
		   	  	laypage({
				 cont:'page',//容器
			     pages:result.totalPages, //总页数
			     curr:curr||1,//当前页
			     skin:'molv',//皮肤
			     skip:true,//
			     last:'尾页',//
			     jump:function(obj,first){
			    	
			    	     if(!first){
			    	    	 searchEmp(obj.curr);
			    	    	 }
			    	 }
			     
				})
		    }
		})
	};
	var updateState=function(){
		
	var empId=$("#employ:checked").val();
		console.log(empId);
		if(empId!=null){
	   	$.ajax({
	   		url:'../emp/updateState',
	   		type:'post',
	   		data:{empId:empId},
	   		dataType:'json',
	   		success:function(result){
	   			alert(result.message);
	   			window.location.reload();
	   		}
	   	})
		}else{
			alert("请选择员工");
		
		}
	};
	
	
	
var getAllOppo=function(curr){
	$.ajax({
		url:'../oppo/getAllOppo',
		type:'post',
		dataType:'json',
		data:{curr:curr},
		success:function(result){
			  $("#conTable tr:not(:first)").html("");
		$.each(result.oppoList,function(inx,ele){
			if(ele.ownerId==1){
		 $("#conTable").append("<tr><td>"+
				 (inx+1)+"</td><td><input type='radio' name='oppo' value='"+
				 ele.oppoManageId+"' /></td><td>"+
				 ele.oppoName+"</td><td>"+
				 ele.oppoType+"</td><td>"+
				 ele.inputTime+"</td><td>"+
				 ele.inputEmp.empRealName+"</td><td>该机会暂未非配</td></tr>");
		 }else{
			 $("#conTable").append("<tr><td>"+
					 (inx+1)+"</td><td><input type='radio' name='oppo' value='"+
					 ele.oppoManageId+"' /></td><td>"+
					 ele.oppoName+"</td><td>"+
					 ele.oppoType+"</td><td>"+
					 ele.inputTime+"</td><td>"+
					 ele.inputEmp.empRealName+"</td><td>"+
					 ele.ownerEmp.empRealName+"</td></tr>"); 
		 }
		  
		})																																										
		
		  $("#conTable").append("<tr><td id='page' colspan='7'></td></tr>"); 	
		   	  	laypage({
				 cont:'page',//容器
			     pages:result.totalPages, //总页数
			     curr:curr||1,//当前页
			     skin:'molv',//皮肤
			     skip:true,//
			     last:'尾页',//
			     jump:function(obj,first){
			    	
			    	     if(!first){
			    	    	 getAllOppo(obj.curr);
			    	    	 }
			    	 }
			     
				})
		}
		
	})
	
};
var saveOppo=function(){
	$.ajax({
		url:'../oppo/saveOppo',
		data:$("#oppo").serialize(),
		type:'post',
		dataType:'json',
		success:function(result){
			alert(result.message);
			window.location.reload();
		}
	})
};
var getOppoMessage=function(){
	var oppoId=$("input[name='oppo']:checked").val();
	if(oppoId !=null){
	$.ajax({
		url:'../oppo/getOppoMessage',
		type:'post',
		data:{oppoId:oppoId},
		dataType:'json',
		success:function(result){
		$("#oppoManageId").val(result.oppo.oppoManageId);
		$("#oppoName").val(result.oppo.oppoName);
		$("#oppoType option[value='"+result.oppo.oppoType+"']").attr('selected','selected');
		$("#oppoContent").text(result.oppo.oppoContent);
		$("#oppoRemarks").text(result.oppo.oppoRemarks);
		}
	})
   }else{
	alert("请选择用户");
	window.location.reload();
  }
};
var updateOppo=function(){
	
	$.ajax({
		url:'../oppo/updateOppo',
		data:$("#oppoMessage").serialize(),
		type:'post',
		dataType:'json',
		success:function(result){
			alert(result.message);
			window.location.reload();
		}
	})
};
var deleteOppo=function(){
	var oppoId=$("input[name='oppo']:checked").val();
	if(oppoId !=null){
		if(confirm("确定删除该机会？")){
		$.ajax({
			url:'../oppo/deleteOppo',
			data:{oppoId:oppoId},
			type:'post',
			dataType:'json',
			success:function(result){
				alert(result.message);
				window.location.reload();
			}
		})
		}
	
	}else{
		alert("请选择用户");
		window.location.reload();
	}
};
var getOppoEmp=function(curr){
	var oppoId=$("input[name='oppo']:checked").val();
	if(oppoId!=null){
	$.ajax({
		url:'../oppo/giveOppoEmp',
		type:'post',
		data:{oppoId:oppoId,curr:curr},
		dataType:'json',
		success:function(result){
			//$("#oppoName1").html("")
	   		 $("#oppoName1").html(result.oppo.oppoName);
	   		//$("#oppoType1").html("");
	   		 $("#oppoType1").html(result.oppo.oppoType);
	   		//$("#oppoContent1").html("");
	   		$("#oppoContent1").html(result.oppo.oppoContent);
	   		//$("#oppoRemarks").html("");
	   		$("#oppoRemarks1").text(result.oppo.oppoRemarks);
			console.log(result);
	   		$("#empList tr:not(:first)").remove();
   			//$("#dept option:not(:first)").remove();
	   	  $.each(result.empList,function(inx,ele){
	   		 $("#empList").append("<tr><td>"+
	   				(inx+1)+"</td><td><input type='radio' name='employ' id='employ' value='"+
	   				ele.empId+"'/></td><td>"+
	   				ele.empRealName+"</td><td>"+
	   				ele.gender+"</td><td>"+
	   				ele.hyd.deptName+"</td><td>"+
	   				ele.hyr.roleName+"</td><td>"+
	   				ele.hireDate+"</td></tr>");
	   	  }) 
	   	  $("#empList").append("<tr><td id='empage' colspan='7'></td></tr>")	
	   	  	laypage({
			 cont:'empage',//容器
		     pages:result.totalPages, //总页数
		     curr:curr||1,//当前页
		     skin:'molv',//皮肤
		     skip:true,//
		     last:'尾页',//
		     jump:function(obj,first){
		    	
		    	     if(!first){
		    	    	 getOppoEmp(obj.curr);
		    	    	 }
		    	 }
		     
			})
	   		
		}
	})
	}else{
		alert("请选择机会");
		window.location.reload();
	}
};
var giveOppo=function(){
var oppoId=$("input[name='oppo']:checked").val();
var empId= $("input[name='employ']:checked").val();
   $.ajax({
	   url:'../oppo/giveOppo',
	   type:'post',
	   data:{oppoId:oppoId,empId:empId},
	   dataType:'json',
	   success:function(result){
		   alert(result.message);
			window.location.reload();
	   }
   })
}
var searchOppo=function(curr){
	var owner=$("input[name='chance']:checked").val();
	var oppoName=$("input[name='chanceName']").val();
	$.ajax({
		url:'../oppo/searchOppo',
		data:{owner:owner,oppoName:oppoName,curr:curr},
		type:'post',
		dataType:'json',
		success:function(result){
			  $("#conTable tr:not(:first)").html("");
				$.each(result.oppoList,function(inx,ele){
					if(ele.ownerId==1){
				 $("#conTable").append("<tr><td>"+
						 (inx+1)+"</td><td><input type='radio' name='oppo' value='"+
						 ele.oppoManageId+"' /></td><td>"+
						 ele.oppoName+"</td><td>"+
						 ele.oppoType+"</td><td>"+
						 ele.inputTime+"</td><td>"+
						 ele.inputEmp.empRealName+"</td><td>该机会暂未非配</td></tr>");
				 }else{
					 $("#conTable").append("<tr><td>"+
							 (inx+1)+"</td><td><input type='radio' name='oppo' value='"+
							 ele.oppoManageId+"' /></td><td>"+
							 ele.oppoName+"</td><td>"+
							 ele.oppoType+"</td><td>"+
							 ele.inputTime+"</td><td>"+
							 ele.inputEmp.empRealName+"</td><td>"+
							 ele.ownerEmp.empRealName+"</td></tr>"); 
				 }
				  
				})																																										
				
				  $("#conTable").append("<tr><td id='page' colspan='7'></td></tr>"); 	
				   	  	laypage({
						 cont:'page',//容器
					     pages:result.totalPages, //总页数
					     curr:curr||1,//当前页
					     skin:'molv',//皮肤
					     skip:true,//
					     last:'尾页',//
					     jump:function(obj,first){
					    	
					    	     if(!first){
					    	    	 searchOppo(obj.curr);
					    	    	 }
					    	 }
					     
						})
				}
	
	})
};
var getCustmerDonate=function(curr){
	$.ajax({
		url:'',
		type:'post',
		data:{curr:curr},
		dataType:'json',
		success:function(result){
			$("#conTable tr:not(:first)").html("");	
			$.each(result.cusList,function(inx,ele){
				$("#conTable").append("<tr><td>"+
						(inx+1)+"</td><td><input type='radio' name='' value='"+
						ele.cust_Id+"'/></td><td>"+
						ele.custMonthDonate+"</td><td>"+
						ele.custMonth+"</td><td>"+
						ele.seeLastYearMonth+"</td><td>"+
						ele.seeLastMonth+"</td></tr>");	
			})
			 $("#conTable").append("<tr><td id='page' colspan='7'></td></tr>"); 		
			laypage({
				 cont:'page',//容器
			     pages:result.totalPages, //总页数
			     curr:curr||1,//当前页
			     skin:'molv',//皮肤
			     skip:true,//
			     last:'尾页',//
			     jump:function(obj,first){
			    	
			    	     if(!first){
			    	    	 getCustmerDonate(obj.curr);
			    	    	 }
			    	 }
			     
				})
		}
	})
}